package main

import "fmt"

//定义一个学生类,有六个属性,分别为姓名、性别、年龄、语文、数学、英语成绩
//第一方法：打招呼的方法：介绍自己叫XX，今年几岁了。是男同学还是女同学。
//第二个方法：计算总分与平均分的
type student struct {
	name    string
	sex     string
	age     int
	chinese float64
	math    float64
	englist float64
}

func (s *student) SayHellow(name string, sex string, age int) {
	s.name = name
	s.sex = sex
	s.age = age
	fmt.Printf("我叫%s,今年%d岁，性别是%s\n", s.name, s.age, s.sex)
}
func (s *student) GetScore(chinese float64, math float64, englist float64) {
	s.chinese = chinese
	s.math = math
	s.englist = englist
	sum := s.chinese + s.math + s.englist
	fmt.Printf("我叫%s,总分%f，平均分%f", s.name, sum, sum/3)

}
func main() {
	var stu student
	stu.SayHellow("zhong", "男", 23)
	stu.GetScore(99.45, 98.34, 96.45)
}
